apply join
Short Description
The apply join executes a LATERAL JOIN if the optimizer cannot de-correlate the query
Detailed Description​
The apply join
executes a lateral join
if the optimizer cannot de-correlate the query and run it using regular joins.
lateral joins
can be memory intensive if the subquery returns a large amount of data, so ensure the subqueries return as few rows as possible.
Performance-wise, these queries can be very slow as they operate one row at a time. If you see an apply join
appearing in your explain plan, you should try to re-write your query to improve performance.
Additional Links​
- CockroachDB Docs - Apply Joins
- CockroachDB Docs - Lateral Subqueries
- CockroachDB Docs - Supported Join Algorithms
- CockroachDB Docs - Cost Based Optimizer
Search online​
If this article doesn't have the information you need you can try searching online. Remember, you can contribute suggestions to this page.